public class Person {
    String name;
    int age;

    public void show(){
        System.out.println(name);
    }

    public static void main(String[] args){
        Person p1 = new Person();
        p1.age = 24;
        p1.name = "张三";
        p1.show();

        Person p2 = new Person();
        p2.age = 35;
        p2.name = "李四";
        p2.show();

        Person p3 = p1;
        p3.age = 80;
        //修改的是p3.age，但因为p3和p1指向同一个地址空间，p1.age也被修改
        System.out.println(p1.age); //输出结果为80
        Person p4 = p1;
    }
}
